package com.sausageking.shared;

import java.io.Serializable;

import javax.persistence.Id;

import com.google.common.base.Objects;
import com.googlecode.objectify.annotation.Unindexed;

@Unindexed
public class Offer implements Serializable {
  private static final long serialVersionUID = 1308690503093542898L;
  @Id
  private Long id;
  public enum REWARD {
    PERCENTAGE_DISCOUNT, // e.g. %30 off
    FLAT_DISCOUNT, // e.g. $2.0 off
    CUSTOMIZED
    // e.g. Free coffee, $X for value of $Y
  }
  private REWARD rewardType;
  private String rewardDescription;
  private double discountValue;

  public enum TRIGGER {
    FIRST_CHECK_IN, EVERY_X_CHECK_INS
  }
  private TRIGGER trigger;
  private int checkinCount;
  
  private String imageUrl;
  
  public Offer() {
    
  }

  public REWARD getRewardType() {
    return rewardType;
  }
  public void setRewardType(REWARD rewardType) {
    this.rewardType = rewardType;
  }
  public String getRewardDescription() {
    return rewardDescription;
  }
  public void setRewardDescription(String rewardDescription) {
    this.rewardDescription = rewardDescription;
  }
  public double getDiscountValue() {
    return discountValue;
  }
  public void setDiscountValue(double discountValue) {
    this.discountValue = discountValue;
  }
  public TRIGGER getTrigger() {
    return trigger;
  }
  public void setTrigger(TRIGGER trigger) {
    this.trigger = trigger;
  }
  public int getCheckinCount() {
    return checkinCount;
  }
  public void setCheckinCount(int checkinCount) {
    this.checkinCount = checkinCount;
  }
  public String toString() {
    return Objects.toStringHelper(this).add("reward type", rewardType.name())
        .add("reward description", rewardDescription)
        .add("trigger", trigger.name()).add("discount", discountValue)
        .add("checkint count", checkinCount)
        .toString();
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getId() {
    return id;
  }

  public String getImageUrl() {
    return imageUrl;
  }

  public void setImageUrl(String imageUrl) {
    this.imageUrl = imageUrl;
  }
}
